import 'package:permission_handler/permission_handler.dart';

Future<bool> checkPermission() async {
  final status = await Permission.camera.status;
  if (!status.isGranted) {
    // 无权限，则请求权限
    PermissionStatus requestStatus = await Permission.camera.request();

    return requestStatus == PermissionStatus.granted;
  } else {

    return true;
  }

}